<template>
  <u-form labelWidth="auto">
    <view>
      <view style="display: flex">
        <view>
          <view class="option" style="width: 520rpx">
            <view class="lf">项目名称</view>
            <view class="rl">{{ filterMultiDictText(this.dictOptions['projectId'], item.projectId + '') }}</view>
          </view>

          <view class="option" style="width: 520rpx">
            <view class="lf">业绩归属年度</view>
            <view class="rl">{{ filterMultiDictText(this.dictOptions['yjgsYear'], item.year + '') }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">签订单位</view>
            <view class="rl">{{ filterMultiDictText(this.dictOptions['signUnit'], item.signUnit + '') }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">业务名称</view>
            <view class="rl">{{ filterMultiDictText(this.dictOptions['taskId'], item.taskId + '') }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">费用所属团队</view>
            <view class="rl">{{ filterMultiDictText(this.dictOptions['teamId'], item.feeTeamId + '') }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">费用所属年度</view>
            <view class="rl">{{ filterMultiDictText(this.dictOptions['feeYear'], item.feeYear + '') }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">合同额（元）</view>
            <view class="rl">{{ item.contractAmount }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">分配合同额（元）</view>
            <view class="rl">{{ item.taskContractAmount }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">回款额（元）</view>
            <view class="rl">{{ item.realCollectionPaymentMoney }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">审批级别</view>
            <view class="rl">{{ filterMultiDictText(this.dictOptions['approvalLevel'], item.approvalLevel + '') }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">难易程度</view>
            <view class="rl">{{ filterMultiDictText(this.dictOptions['difficultyLevel'], item.difficultyLevel + '') }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">任务进度</view>
            <view class="rl">{{ item.progressName }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">报告编制绩效（元）</view>
            <view class="rl">{{ item.reportAchievements }}</view>
          </view>
          <view class="option" style="width: 520rpx">
            <view class="lf">绩效提取金额（元）</view>
            <view class="rl">{{ item.achievementsMoney }}</view>
          </view>
        </view>

        <view style="flex: 1; display: flex; align-items: center; justify-content: flex-end">
          <u-icon name="edit-pen-fill" color="#2979ff" size="20" @click="handleEidtForm(item, index)"></u-icon>
          <u-line direction="col" length="20" margin="0 10rpx"></u-line>
          <u-icon name="trash-fill" color="red" size="20" @click="handleRemoveForm(item)"></u-icon>
        </view>
      </view>
    </view>
  </u-form>
</template>

<script>
import { filterMultiDictText, initDictOptions } from '@/utils/JDictSelectUtil.js'
// import selectTaskProgressInput from '@/pages/synergy/components/selectTaskProgressInput.vue'

export default {
  name: 'ErpAchievementsExtractionFormInfo',
  components: {
    // selectTaskProgressInput,
  },
  props: {
    index: {
      type: Number,
      default: null,
    },
    item: {
      type: Object,
      default: () => ({}),
    },
    progressVoList: {
      type: Array,
      default: () => [],
    },
    disabled: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      filterMultiDictText,
      initDictOptions,
      dictOptions: {},
      // smallList: [],
    }
  },
  created() {
    this.initDictConfig()
  },
  watch: {
    item: {
      handler(val) {},
      immediate: true,
      deep: true,
    },
  },
  methods: {
    handleCopyForm(item) {
      this.$emit('copy', [item, this.index])
    },
    handleEidtForm(item) {
      this.$emit('edit', [item, this.index])
    },
    handleRemoveForm(item) {
      uni.showModal({
        content: '确定删除吗？',
        success: (res) => {
          if (res.confirm) {
            this.$emit('remove', item)
          }
        },
      })
    },
    initDictConfig() {
      initDictOptions('erp_omc_team_manager,alias_name,id').then((res) => {
        if (res.success) {
          this.$set(this.dictOptions, 'teamId', res.result)
        }
      })
      initDictOptions('erp_omc_project,project_name,id').then((res) => {
        if (res.success) {
          this.$set(this.dictOptions, 'projectId', res.result)
        }
      })
      initDictOptions('erp_omc_project_task,category_name,id').then((res) => {
        if (res.success) {
          this.$set(this.dictOptions, 'taskId', res.result)
        }
      })
      initDictOptions('yjgsnd').then((res) => {
        if (res.success) {
          this.$set(this.dictOptions, 'yjgsYear', res.result)
        }
      })
      initDictOptions('tdnd_type').then((res) => {
        if (res.success) {
          this.$set(this.dictOptions, 'feeYear', res.result)
        }
      })
      initDictOptions('approval_level').then((res) => {
        if (res.success) {
          this.$set(this.dictOptions, 'approvalLevel', res.result)
        }
      })
      initDictOptions('industry_coefficient').then((res) => {
        if (res.success) {
          this.$set(this.dictOptions, 'difficultyLevel', res.result)
        }
      })
      initDictOptions('erp_company_files,file_name,id').then((res) => {
        if (res.success) {
          this.$set(this.dictOptions, 'signUnit', res.result)
        }
      })
    },
  },
}
</script>

<style scoped lang="scss">
.inforamtion {
  margin-top: 10rpx;
  padding: 10rpx;
  border-radius: 15rpx;
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
}
</style>
